<template>
	<view class="page">
		<view style="height:30rpx;"> </view>
		<view class="list_class" v-for="item in listData" @click="toPublish(item)">
			<image :src="item.image" style="width:245rpx;height:140rpx;border-radius:20rpx;border:1px solid #eee;"
				mode="aspectFill" />
			<view class="content">
				<view class="title"> {{item.title||""}} </view>
				<view class="guanjianzi">
					{{item.remarks||""}}
				</view>
				<view style="display:flex;justify-content:flex-end;">
					<view class="fabu_btn">
						前往发布
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				listData: []
			}
		},
		onShow() {
			this.$u.api.tasktypeAll({}).then(res => {
				if (res.code == 200) {
					this.listData = res.items
				}
			})
		},
		methods: {
			// 填写发布
			toPublish(item) {
				uni.navigateTo({
					url: '/pages/publish/index?id=' + item.id + "&title=" + item.title
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		min-height: 100vh;
		background-color: #F6F9FF;

		.list_class {
			background-color: #fff;
			border-radius: 20rpx;
			margin: 0 40rpx 30rpx 40rpx;
			padding: 30rpx;
			display: flex;

			.content {
				flex-grow: 1;
				margin-left: 30rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				letter-spacing: 4rpx;

				.title {
					font-weight: bold;
					font-size: 30rpx;
					color: #333333;
				}

				.guanjianzi {
					font-weight: 400;
					font-size: 24rpx;
					color: #AFB8C9;
				}

				.fabu_btn {
					font-weight: 400;
					font-size: 22rpx;
					color: #FFFFFF;
					background: #2979ff;
					border-radius: 30rpx;
					width: 140rpx;
					height: 44rpx;
					text-align: center;
					line-height: 44rpx;
				}
			}
		}
	}
</style>